package game.engine.base


data class Vec2(var x:Float = 0f,var y:Float = 0f){
    class Vec2Pool: Pool<Vec2>() {
        override fun create(): Vec2 = Vec2()
    }

    companion object {
        val pool = Vec2Pool()
    }

    fun set(px:Float,py:Float):Vec2{
        x = px
        y = py
        return this
    }

    fun add(px:Float,py:Float):Vec2{
        x += px
        y += py
        return this
    }

}